<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我是一阵风直播</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style>
        #aui-header{position: fixed;}
        #video-main{margin-bottom:3rem;}
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav" id="aui-header">
        <div class="aui-title">直播中心</div>
    </header>

    <section class="aui-content" id="video-main">
      <section class="aui-content-padded login-sub" id="islive">
          <div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="openFrm('my_gift_frm')">创建直播</div>
      </section>

        <div class="aui-card-list aui-border-t aui-border-b"  v-for="s in sites">
            <div class="aui-info aui-padded-l-15 aui-padded-r-15">
                <div class="aui-info-item aui-font-size-12">
                    <img src="../image/share/wx.png" style="width:1rem" class="aui-img-round" />
                    <span class="aui-margin-l-5">{{ s.title }}</span>
                </div>
                <div class="aui-info-item">
                    <i class="aui-iconfont aui-icon-forward"></i>
                </div>
            </div>
            <div class="aui-card-list-content">
                <img :src="s.live_cover" style="width:100%;height:11rem;"/>
            </div>
            <div class="aui-card-list-content-padded aui-padded-t-0 aui-padded-b-0" style="color:#7b7b7b;">
                {{s.intro}}
            </div>
            <div class="aui-card-list-footer aui-font-size-12" style="color:#999;">
                <div class="text-info">
                    <span>204 人观看</span> - <span>2095 条评论</span> - <span>点击观看</span>
                </div>
            </div>
        </div>

    </section>
    <footer class="aui-bar aui-bar-tab" id="aui-footer">
        <div class="aui-bar-tab-item aui-active">
            <i class="aui-iconfont aui-icon-video aui-active"></i>
            <div class="aui-bar-tab-label">直播中心</div>
        </div>
        <div class="aui-bar-tab-item" tapmode onclick="openFrm('my_frm');">
            <i class="aui-iconfont aui-icon-my"></i>
            <div class="aui-bar-tab-label">我的</div>
        </div>
    </footer>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/common.js" ></script>
<script type="text/javascript" src="../script/vue.js" ></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript">
apiready = function () {
    fixStatusBar();
    $api.css($api.byId('video-main'),'margin-top:'+headerHeight+'px;');

    //监听创建直播成功隐藏按钮：
    api.addEventListener({
        name: 'hidebtn'
    }, function(ret, err) {
      if (ret.value.state == 'no') {
          abc();
      }

    });

    function abc() {
             window.location.reload();//刷新页面
         };

    var userid= $api.getStorage('userid');
    $api.post(baseUrl+'live/live/my_video',{
    body: 'String',values:{user_id:userid}
  },function(ret){
      var newret = JSON.parse(ret);
    if(newret.code==1){
      $("#islive").hide();

    }
  },'text');

    api.parseTapmode();
    var is_login = $api.getStorage('isLogin');
    fnOpenMainFrame(is_login);
    function getlist(){
      api.showProgress();
       api.ajax({
           url: 'http://www.qiersan.com/live/live/videos',
           method: 'post',
           data: {
               values: {
                   name: 'haha'
               },
           }
       },function(ret, err){
         api.hideProgress();//隐藏加载进度框
         new Vue({
           el: '#video-main',
           data: {
             sites:ret
           }
         })


       });


      }

      getlist();

}
</script>
</html>
